import api from './index'

export async  function getQrcode(){

    let res = await api({
        url:'/h5Api/login/captcha',
        method:'get'
    })

    return res.data
}

//获取答题活动
export async function getQuestionAct(){

    let res = await api({
        url:'/h5Api/answer/getQuestionAct',
        method:'get',
    })

    return res.data
}

export async  function login(params){

    let res = await api({
        url:'/h5Api/login/accountLogin',
        method:'post',
        data:params
    })

    return res.data
}
export async  function userDetail(params){

    let res = await api({
        url:'/h5Api/index/detail',
        method:'get',
    })

    return res.data
}
export async  function homeIndex(params){

    let res = await api({
        url:'/h5Api/index/index',
        method:'get',
    })

    return res.data
}


export async  function lotteryRecord(){

    let res = await api({
        url:'/h5Api/index/lotteryRecord',
        method:'get',
    })

    return res.data
}

export async  function drawLottery(){

    let res = await api({
        url:'/h5Api/index/drawLottery',
        method:'post',
    })

    return res.data
}

// 盲盒列表
export async function blindBoxList(params){
    let res = await api({url:'/h5Api/blindBox/list',method:"get",params})
    return res.data
}
// 抽取盲盒
export async function useBlindBox(data){
    let res = await api({url:'/h5Api/blindBox/useBlindBox',method:"post",data})
    return res.data
}
// 盲盒详情
export async function prizeDetails(params){
    let res = await api({url:'/h5Api/blindBox/rewardDetail',method:"get",params})
    return res.data
}
// 立即兑奖
export async function exReward(data){
    let res = await api({url:'/h5Api/blindBox/exReward',method:"post",data})
    return res.data
}
// 立即收货
export async function receiveImmediately(data){
    let res = await api({url:'/h5Api/blindBox/receiveBlindAlready',method:"post",data})
    return res.data
}
// 中奖下单
export async function winningAndPlacingAnOrder(data){
    let res = await api({url:'/h5Api/flashSale/placeOrder',method:"post",data})
    return res.data
}
// 答题中途退出
export async function exitAnswer(data){
    let res = await api({url:'/h5Api/answer/exitAnswer',method:"get",data})
    return res.data
}

export async function answerList(params){
    let res = await api({url:'/h5Api/answer/list',method:"get",params})
    return res.data
}
export async function submitAnswers(data){
    let res = await api({url:'/h5Api/answer/submitAnswer',method:"post",data})
    return res.data
}
// 获取语言
export async  function getLanguageInfo(data){
    let res = await api({
        url:'/h5Api/answer/languageList',
        method:'get'
    })

    return res.data
}
export async function answerRecord(params){
    let res = await api({url:'/h5Api/answer/answerRecord',method:"get",params})
    return res.data
}
